﻿// See https://aka.ms/new-console-template for more information
using ConsoleApp1;
using System.Text.Json.Serialization;
using System.Xml;

Console.WriteLine("Hello, World!");

SmsService smsService = new SmsService();
Console.WriteLine(smsService.GenerateCode());

//string xmlString = @"<xml>
//          <ToUserName><![CDATA[toUser]]></ToUserName>
//          <FromUserName><![CDATA[fromUser]]></FromUserName>
//          <CreateTime>12345678</CreateTime>
//          <MsgType><![CDATA[text]]></MsgType>
//          <Content><![CDATA[你好]]></Content>
//        </xml>";

//var model = XMLSerilizable.XMLToObject<MessageText>(xmlString);
//Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(model));



string xmlString1 = @"<xml>
          <ToUserName><![CDATA[toUser]]></ToUserName>
          <FromUserName><![CDATA[fromUser]]></FromUserName>
          <CreateTime>1546924844</CreateTime>
          <MsgType><![CDATA[event]]></MsgType>
          <Event><![CDATA[guide_qrcode_scan_event]]></Event>
          <GuideScanEvent>
            <qrcode_guide_account>![CDATA[xxx]]</qrcode_guide_account>
            <qrcode_guide_openid>![CDATA[xxx]]</qrcode_guide_openid>
            <openid>![CDATA[xxx]]</openid>
            <action>11</action>
            <qrcode_info>![CDATA[xxx]]</qrcode_info>
          </GuideScanEvent>
        </xml>";


var model0 = XMLSerilizable.XMLToObject<MessageEventGuideInviteResultEven>(xmlString1);
Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(model0));

//var model1 = XMLSerilizable.ParseNestedXml<MessageEventGuideInviteResultEven>(xmlString1);
//Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(model1));


//var model2 = WxXmlParser.ParseWithCData<MessageEventGuideInviteResultEven>(xmlString1);
//Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(model2));


